<template>
  <div class="message-box">{{message}}</div>
</template>

<script>
export default {
  name: 'Message',
  props: {
    message: String
  },
  mounted () {
    setTimeout(() => {
      this.$destroy()
      document.body.removeChild(this.$el)
    }, 3000)
  }
}
</script>

<style lang="scss" scoped>
.message-box {
  @include wh(100%, auto);
  position: fixed;
  top: 0;
  left: 0;
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  background: $base-color;
  color: #fff;
  font-size: $font-size-m;
  z-index: 1000000;
}
</style>
